Skip to content

Conversation

@tesaide
Copy link
Contributor

@tesaide tesaide commented Dec 24, 2025

No description provided.

index.ts Outdated
return rows[0][countryCol];
}
}
} catch (e) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add something to catch

index.ts Outdated

{ insecureRawSQL: `"${countryCol}" IS NOT NULL` }
]
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yaroslav8765 could you please use Filters.AND Filters.EQ and so on, instead of row notation used by Oleksander. Also could we add another filters operations Filters.IsEmpty(field) and Filters.isNotEmpty(field) - for sql databses IsEmpty is IS NULL, and isNotEmpty IS NOT NULL. For mongo it check against undefined

index.ts Outdated

// API Request
try {
const apiUrl = `https://geoip.vuiz.net/geoip?ip=${clientIp}`;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vuiz sounds like something unknown without defined limints, please lets use something more reliable with strict policy, e.g.

https://ipinfo.io/pricing

curl https://ipinfo.io/8.8.8.8/json

}, {});

// Cloudflare Check (Fastest)
const cfCountry = headersLower['cf-ipcountry'];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yaroslav8765 move 'cf-ipcountry' to plugin options and mention in docs. Name:

// should be in format ISO 3166-1 alpha-2
// e.g. for ckloudflare it should be 'CF-IPCountry'
isoCountryCodeRequestHeader: string

return cfCountry.toUpperCase();
}

if (!clientIp || clientIp === '127.0.0.1' || clientIp === '::1' || clientIp.includes('localhost')) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not needed because getClinetIp (Af internal) already should return null for any private CIDR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants